home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 301-325 / disk_311 / echo / echo.doc < prev    next >
Text File  |  1992-05-06  |  7KB  |  189 lines

  1.  
  2.        Program:  echo
  3.     Programmer:  George Kerber  
  4.        Written:  08/26/89 - 09/13/89
  5.        Version:  1.07
  6.    Application:  AmigaDOS
  7.        Purpose:  Echo is an AmigaDOS replacement that will emulate the AmigaDOS
  8.                  echo, yet provide many options and versatility.
  9.         
  10. SYNTAX:  echo [-options] ["quoted string"] [NOLINE]
  11.  
  12. OPTIONS:  (for non-programmers "|" means "or")
  13.  
  14.    ?         A help screen will be displayed.
  15.   -a n,n...  Change attributes, where "n" is one or more of the values
  16.              specified below separated by commas.
  17.          _______________________________________________________________________
  18.  
  19.          These options are used as co-options to -a or escape characters
  20.          which are described below.
  21.  
  22.              0   Text, color 0, default is blue.
  23.              1   Text, color 1, default is white.
  24.              2   Text, color 2, default is black.
  25.              3   Text, color 3, default is orange
  26.            D|4   Reset all attributes to default preference settings.
  27.            B|5   Text, bold face.
  28.            U|6   Text, underline.
  29.            I|7   Text, italics.
  30.              )   Background, color 0. (Shift 0)   Don't try to remember the
  31.              !   Background, color 1. (Shift 1)   actual character, just 
  32.              @   Background, color 2. (Shift 2)   remember <shift> color # 
  33.              #   Background, color 3. (Shift 3)   for background color changes.
  34.          _______________________________________________________________________
  35.  
  36.   -c         Clear screen.
  37.   -e         Clear from cursor to bottom of the screen.
  38.   -k         Do not reset attributes set by echo options to default.
  39.              (Normally, all attributes are set to default when echo exits)
  40.   -n         Same as NOLINE as the last option after the string, doesn't do a
  41.              newline after printing string.  NOLINE is provided for
  42.              compatibility with the AmigaDOS echo.  NOLINE & -n do the same
  43.              thing.
  44.   -z         Will automatically set the -n (NOLINE) option and will supress
  45.              the visable cursor at the end of the "echoed" string.
  46.              This is useful only if no other echo lines will be displayed 
  47.              before the next clear screen.
  48.   -x         Center string on screen.  This option is incompatable with -m
  49.              or -p unless x = 0.
  50.   -m n       Begin printing string at "n" character position on the current
  51.              line. (0-77)  Can't be used with -x.
  52.   -u|d n     Move cursor up|down "n" lines.
  53.   -h|r n     Scroll screen up|down "n" lines.
  54.   -p x,y     Place cursor at position x,y, where,
  55.              x = character position (0-77) & y = line (1-23).
  56.              If used with -x, then x (char position) must be 0.
  57.   
  58. VALID ESCAPE VALUES: (lower case only)
  59.  
  60.    n         Creates a newline
  61.    t         Adds a tab
  62.    b         Backspace
  63.    q         Prints a quote (")        
  64.    $         Only necessary if the first character of the string is a '-'.
  65.  
  66.             
  67.    Plus, all characters listed above for the -a option can be used.  Like
  68.    the color options.  See the examples below.
  69.  
  70. AmigaDOS defaults to a '*' as the escape character for echo.  You can change
  71. this if you like by using the AmigaDOS 1.3 command 'setenv'.  This function
  72. retains compatibility with the ARP echo command.
  73.  
  74.            1> setenv ESCAPE "\"     ;or whatever you want.
  75.            1>
  76.  
  77. If ESCAPE is set to more than one character, echo will use the first
  78. character.  To actually print a literal escape character you must enter it
  79. twice to print it once.
  80.  
  81.            1> echo "example to print two **** stars ****"
  82.            example to print two ** stars **
  83.            1>
  84.  
  85.  
  86. INSTALLATION:  Replace the existing AmigaDOS echo command in your c: 
  87. directory with this new echo command.
  88.  
  89.            1> copy echo c:
  90.            1>
  91.  
  92.  
  93. A WORD ABOUT QUOTING:  Unlike the AmigaDOS echo, you don't have to quote the
  94. string as long as there are no spaces in the string.  I would suggest
  95. quoting all strings as a matter of habit.  To actually print a quote in your
  96. string, you must escape a 'q'.
  97.  
  98.            1> echo " the word *qquote*q is quoted "
  99.            the word "quote" is quoted
  100.            1>
  101.  
  102. PROGRAM OPERATION:  Any -options given on the command line are performed
  103. before any escape characters in the string are evaluated.  So any position,
  104. or color, etc. -options are executed before the input string is ever looked
  105. at.  Any escape options given in the input string are done in the order they
  106. are entered.  This can be important to give options in the proper order and to
  107. know when to use a -option or an escape option to achieve the desired
  108. result.  You may have to experiment.  Check out the echo.examples script
  109. for some help in this area.  Most of the time, there is no problem using
  110. either the -options or escape options in any order.  But, consider this
  111. line:
  112.  
  113.            1>  echo -d 5 -a 5,3,@ -c "testing the -c option"
  114.  
  115. First the cursor is moved down 5 lines, then the text attributes are set
  116. to bold, orange and black background, and THEN THE SCREEN IS CLEARED!
  117. See the trouble?  Always clear the screen first.
  118.  
  119. Escape options are used in the actual input string to be printed, but the
  120. escape character and escape option are not printed, just the text.
  121.  
  122.        <newline><newline><tab>example <quote>line<quote><newline><newline>
  123.  
  124.            1>  echo "*n*n*texample *qline*q*n*n"
  125.  
  126.  
  127.                example "line"
  128.  
  129.            1>
  130.  
  131.  
  132. There are sometimes more than one way to do the same thing.  The following
  133. three lines will do the exact same thing.
  134.  
  135.            1> echo -a 3,5,@ "bolded, orange with black background"
  136.  
  137.            1> echo "*3*5*@bolded, orange with black background"
  138.           
  139.            1> echo "^[[33m^[[1m^[[42mbolded, orange with black background"
  140.  
  141. Actually the second and third example are exactly the same as to the string
  142. that is printed to the screen.  But the codes shown are hard to remember, so
  143. I recommend using the numeric codes as shown in the first and second example.
  144. As you can see, the escape values can change attributes too.  This can be
  145. very useful to print text of more than one attribute in the same line.
  146.  
  147.            1> echo "*3orange, *5orange bolded, *4*2black, *4reset"
  148.  
  149. Note that the blank space between the -options and the argument to that
  150. option is optional.  The following two lines are identical.
  151.  
  152.            1>  echo -c -p 10,14 -d5 "test string"
  153.  
  154.            1>  echo -c -p10,14 -d 5 "test string"
  155.  
  156. Echo will interpert any option starting with a '-' as an option even if you
  157. have the string quoted.  This will still clear the screen:
  158.  
  159.            1>  echo "-c"
  160.  
  161. And this will cause an "Invalid Option" error:
  162.  
  163.            1>  echo "-s"     (since 's' is not a valid option)
  164.  
  165. To actually print a '-' dash at the beginning of a string, it must be escaped
  166. using the '$' escape value.
  167.  
  168.            1>  echo "*$-c"
  169.                        -c
  170.            1>
  171.  
  172. MORE EXAMPLES:  Execute the echo.examples file, then see how it was done.
  173.  
  174.  
  175. CREDITS:  See the echo.credits file.
  176.  
  177.  
  178. STATUS:  This is public domain, but please keep me as author and keep all
  179. the documentation intact.  Anyway, if something is wrong with this program,
  180. I'm not responsible.....
  181.  
  182.  
  183.                                  George Kerber
  184.                                  19756 E. Linvale Drive
  185.                                  Aurora, Colorado  80013
  186.                                  (303) 693-2890
  187.  
  188.                                  Compuserve: 74010.2132
  189.